tar = [1, 2, 3, 4]
count = 0  # 结果计数
for i in range(len(tar)):
    x = str(tar.pop(i))
    for j in range(len(tar)):
        y = str(tar.pop(j))
        for k in range(len(tar)):
            print(x + y + str(tar[k]), end='  ')
            count += 1
        tar.insert(j, int(y))
    tar.insert(i, int(x))
    print('')
print("最终结果为：{}个".format(count))